//
//  NSMutableAttributedString+Utils.m
//  jiaoquaner
//
//  Created by 郝旭珊 on 2017/12/4.
//  Copyright © 2017年 yimofang. All rights reserved.
//

#import "NSMutableAttributedString+XSExtension.h"

@implementation NSMutableAttributedString (XSExtension)

+ (instancetype)attributeOfDifferentColorWithText1:(NSString *)text1
                                    color1:(UIColor *)color1
                                     text2:(NSString *)text2
                                    color2:(UIColor *)color2{
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]init];
    NSAttributedString *attrStr1 = [[NSMutableAttributedString alloc]initWithString:text1 attributes:@{NSForegroundColorAttributeName:color1}];
    NSAttributedString *attrStr2 = [[NSMutableAttributedString alloc]initWithString:text2 attributes:@{NSForegroundColorAttributeName:color2}];
    [attr appendAttributedString:attrStr1];
    [attr appendAttributedString:attrStr2];
   
    return attr;
}

@end
